This function reads the solutions from the file "solutions" and appends them to the KM-file km (km is the file name). The value lambda is stored with the solutions and there can be one set of solutions for each value of lambda in each KM-file.
Example:
gap> get_solutions_from_solver(km, 12); discreta_batch get_solutions_from_solver KM_PGGL_2_32_t5_k6.txt 12 gap>Transfers the 54 solutions for lambda = 12 into the KM-file "KM_PGGL_2_32_t5_k6.txt".
Retrieves the number of solutions stored in the KM-file for a given value of lambda
Example:
gap> no := get_number_of_solutions(km, 12); discreta_batch get_number_of_solutions KM_PGGL_2_32_t5_k6.txt discreta_batch_o\ utput.g discreta_tmp 12 54 gap>
Example:
gap> s := get_solutions(km, 12, 1, no); discreta_batch get_solutions KM_PGGL_2_32_t5_k6.txt discreta_batch_output.g di\ screta_tmp 12 1 54 [ [ 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0 ], [ 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0 ], [ 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0 ], [ 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0 ], [ 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0 ], [ 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0 ], [ 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0 ], [ 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0 ], [ 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0 ], [ 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0 ], [ 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0 ], [ 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0 ], [ 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0 ], [ 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0 ], [ 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 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, 0, 1, 1, 0 ], [ 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0 ], [ 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0 ], [ 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0 ], [ 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0 ], [ 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0 ], [ 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0 ], [ 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0 ], [ 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0 ], [ 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0 ], [ 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0 ], [ 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0 ], [ 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0 ], [ 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0 ], [ 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0 ], [ 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0 ] ] gap> s[1]; [ 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0 ] gap> M * s[1]; [ 12, 12, 12 ] gap>We retrieve all 54 solutions (numbers 1-54) from the KM-file and store them in a vector s. We check the solutions s[1] by multiplying it from the right to the KM-matrix M.
Checks the solutions in the file "solutions"
Example:
Back
to the DISCRETA-GAP interface
Back to the typical GAP-session
Last updated: July 26, 1999, Evi Haberberger